<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
   <!--页面唤起电话  <meta name="format-detection" content="telephone=yes"/> -->
    <title>测试页面</title>
    <link rel="stylesheet" href="frame/layui/css/layui.css">
    <link rel="stylesheet" href="frame/static/css/style.css">
    <link rel="icon" href="frame/static/image/code.png">
</head>
<body>
<button type="button" class="layui-btn" id="test1">
  <i class="layui-icon">&#xe67c;</i>上传图片
</button>
 
<script src="frame/layui/layui.js"></script>
<script>
layui.use('upload', function(){
  var upload = layui.upload;
   
  //执行实例
  var uploadInst = upload.render({
    elem: '#test1' //绑定元素
    ,url: 'http://152.136.136.209:8081/file/upload' //上传接口
    ,done: function(res){
      //上传完毕回调
      alert(res);
    }
    ,error: function(){
      //请求异常回调
    }
  });
});
</script>
</body>
</html>